package market

type BaiYingCallBackRequest struct {
	Code      int                         `json:"code"`
	ResultMsg string                      `json:"resultMsg"`
	Data      *BaiYingCallBackRequestData `json:"data"`
}

type BaiYingCallBackRequestData struct {
	CallbackType string        `json:"callbackType"`
	Data         *CallBackData `json:"data"`
}

type CallBackData struct {
	CallInstance  *CallJobInstance `json:"callInstance"`
	JobPhoneInfos []*JobPhoneInfo  `json:"jobPhoneInfos"`
	PhoneLogs     []*PhoneLog      `json:"phoneLogs"`
	TaskResult    []*TaskResult    `json:"taskResult"`
	CallRepeat    []*CallRepeat    `json:"callRepeat"`
}

type CallRepeat struct {
	FinishStatus int    `json:"finishStatus"`
	RepeatIndex  int    `json:"repeatIndex"`
	StartTime    int64  `json:"startTime"`
	CallerPhone  string `json:"callerPhone"`
	EndTime      int64  `json:"endTime"`
}

type TaskResult struct {
	ResultValue  string         `json:"resultValue"`
	ResultDesc   string         `json:"resultDesc"`
	ResultLabels []*ResultLabel `json:"resultLabels"`
	ResultName   string         `json:"resultName"`
}

type ResultLabel struct {
	Value string `json:"value"`
	Key   int    `json:"key"`
}

type JobPhoneInfo struct {
	LineName        string `json:"lineName"`
	CallerAccountId int    `json:"callerAccountId"`
}

type PhoneLog struct {
	CallInstanceId int64  `json:"callInstanceId"`
	AiUnknown      int    `json:"aiUnknown"`
	Speaker        string `json:"speaker"`
	StartTime      int    `json:"startTime"`
	UserMean       string `json:"userMean"`
	EndTime        int    `json:"endTime"`
	Content        string `json:"content"`
	DecisionName   string `json:"decisionName"`
	AnswerStatus   int    `json:"answerStatus"`
}

type CallJobInstance struct {
	ChatRound          int32                  `json:"chatRound"`
	CallJobId          int64                  `json:"callJobId"`
	CollectProperties  map[string]interface{} `json:"collectProperties"`
	UserLuyinOssUrl    string                 `json:"userLuyinOssUrl"`
	Duration           int32                  `json:"duration"`
	CallInstanceStatus int32                  `json:"callInstanceStatus"`
	StartTime          string                 `json:"startTime"`
	EavesdropIntercept bool                   `json:"eavesdropIntercept"`
	JobName            string                 `json:"jobName"`
	CallInstanceId     int64                  `json:"callInstanceId"`
	CalledTimes        int                    `json:"calledTimes"`
	CsDuration         int                    `json:"csDuration"`
	CustomerTelephone  string                 `json:"customerTelephone"`
	NotifyEavesdrop    bool                   `json:"notifyEavesdrop"`
	CustomerName       string                 `json:"customerName"`
	HangUp             int32                  `json:"hangUp"`
	RobotDefId         int                    `json:"robotDefId"`
	CompanyId          int64                  `json:"companyId"`
	FinishStatus       int32                  `json:"finishStatus"`
	LuyinOssUrl        string                 `json:"luyinOssUrl"`
	PerceptionResult   string                 `json:"perceptionResult"`
	Eavesdrop          bool                   `json:"eavesdrop"`
	EndTime            string                 `json:"endTime"`
	RobotDefName       string                 `json:"robotDefName"`
	Properties         map[string]interface{} `json:"properties"`
}

type GetCrowdListRequest struct {
	CrowdName string `json:"crowd_name"`
	Status    int32  `json:"status"`
	Page      int32  `json:"page"`
	PageSize  int32  `json:"page_size"`
}

type AddCrowdRequest struct {
	Id                    int32    `json:"id"`
	CrowdName             string   `json:"crowd_name" form:"crowd_name" binding:"required" err:"crowd_name不能为空"`
	Type                  string   `json:"type" form:"type" binding:"required" err:"type不能为空"`
	Version               int32    `json:"version"`
	AreaCode              []string `json:"area_code"`
	AreaName              []string `json:"area_name"`
	WinbidKeyword         []string `json:"winbid_keyword"`
	CompanyKeyword        []string `json:"company_keyword"`
	WinbidDateStart       string   `json:"winbid_date_start"`
	WinbidDateEnd         string   `json:"winbid_date_end"`
	PhoneType             []string `json:"phone_type"`
	EveryCompanyNum       int32    `json:"every_company_num"`
	BidKeyword            []string `json:"bid_keyword"`
	BidKeywordExclude     []string `json:"bid_keyword_exclude"`
	BidDateStart          string   `json:"bid_date_start"`
	BidDateEnd            string   `json:"bid_date_end"`
	IsLandOpen            int32    `json:"is_land_open"`
	LandUsage             []string `json:"land_usage"`
	LandDateStart         string   `json:"land_date_start"`
	LandDateEnd           string   `json:"land_date_end"`
	IsBuildingOpen        int32    `json:"is_building_open"`
	BuildingType          []string `json:"building_type"`
	BuildingDateStart     string   `json:"building_date_start"`
	BuildingDateEnd       string   `json:"building_date_end"`
	IsSaleOpen            int32    `json:"is_sale_open"`
	SaleType              []string `json:"sale_type"`
	SaleDateStart         string   `json:"sale_date_start"`
	SaleDateEnd           string   `json:"sale_date_end"`
	ProjectKeyword        []string `json:"project_keyword"`
	CompanyTotal          int32    `json:"company_total"`
	ContactTotal          int32    `json:"contact_total"`
	LogicType             string   `json:"logic_type"`
	IsBidOpen             int32    `json:"is_bid_open"`
	LandKeyword           []string `json:"land_keyword"`
	BuildingKeyword       []string `json:"building_keyword"`
	SaleKeyword           []string `json:"sale_keyword"`
	CompanyType           []string `json:"company_type"`
	CompanyKeywordExclude []string `json:"company_keyword_exclude"`
}

type GetCrowdDetailRequest struct {
	Id int32 `json:"id" form:"id" binding:"required" err:"id不能为空"`
}

type DeleteCrowdRequest struct {
	Id int32 `json:"id" form:"id" binding:"required" err:"id不能为空"`
}

type TaskImportCrowdRequest struct {
	TaskId    int64  `json:"task_id" binding:"required" err:"任务id参数不能为空"`
	CrowdId   int64  `json:"crowd_id" binding:"required_without=FileId" err:"人群包和文件不能都为空"`
	FileId    string `json:"file_id" binding:"required_without=CrowdId" err:"人群包和文件不能都为空"`
	CompanyId int64
}

type GetOutboundClueListRequest struct {
	Keyword      string   `json:"keyword"`
	TenantCode   string   `json:"tenant_code"`
	TaskId       int64    `json:"task_id"`
	Intention    []string `json:"intention"`
	DurationMin  int32    `json:"duration_min"`
	DurationMax  int32    `json:"duration_max"`
	ChatRoundMin int32    `json:"chat_round_min"`
	ChatRoundMax int32    `json:"chat_round_max"`
	FinishStatus []int32  `json:"finish_status"`
	StartDate    string   `json:"start_date"`
	EndDate      string   `json:"end_date"`
	AuditStatus  int32    `json:"audit_status"`
	Page         int32    `json:"page"`
	PageSize     int32    `json:"page_size"`
}

type OutboundClueExportRequest struct {
	Ids          []int64  `json:"ids" form:"ids" binding:"max=10000" err:"导出记录ids不能超过一万条"`
	Keyword      string   `json:"keyword"`
	TaskId       int64    `json:"task_id"`
	Intention    []string `json:"intention"`
	DurationMin  int32    `json:"duration_min"`
	DurationMax  int32    `json:"duration_max"`
	ChatRoundMin int32    `json:"chat_round_min"`
	ChatRoundMax int32    `json:"chat_round_max"`
	FinishStatus []int32  `json:"finish_status"`
	StartDate    string   `json:"start_date"`
	EndDate      string   `json:"end_date"`
}

type ExportUnCallListRequest struct {
	TaskId          int64   `json:"task_id" binding:"required" err:"任务id不能为空"`
	CallInstanceIds []int64 `json:"call_instance_ids" form:"call_instance_ids" binding:"max=10000" err:"导出记录ids不能超过一万条"`
}

type CreateTaskRequest struct {
	TaskName         string  `json:"task_name" binding:"max=255" err:"任务名称长度不能超过 255 个字符"`
	TaskType         int32   `json:"task_type" binding:"oneof=1 2" err:"非法的任务类型"`
	StartDate        string  `json:"start_date"`
	RobotDefId       int64   `json:"robot_def_id" binding:"required" err:"话术不能为空"`
	UserPhoneIds     []int64 `json:"user_phone_ids" binding:"required" err:"线路不能为空"`
	ConcurrencyQuota int32   `json:"concurrency_quota" binding:"required" err:"坐席数量不能为空"`
	RepeatCallCnt    int32   `json:"repeat_call_cnt" binding:"max=5" err:"重播次数最多只能 5 次"`
	PushUserIds      []int64 `json:"push_user_ids" binding:"required" err:"推送设置不能为空"`
}

type UpdateTaskRequest struct {
	TaskId           int64   `json:"task_id" binding:"required" err:"任务 id 不能为空"`
	TaskName         string  `json:"task_name" binding:"max=255" err:"任务名称长度不能超过 255 个字符"`
	TaskType         int32   `json:"task_type" binding:"oneof=1 2" err:"非法的任务类型"`
	StartDate        string  `json:"start_date"`
	RobotDefId       int64   `json:"robot_def_id" binding:"required" err:"话术不能为空"`
	UserPhoneIds     []int64 `json:"user_phone_ids" binding:"required" err:"线路不能为空"`
	ConcurrencyQuota int32   `json:"concurrency_quota" binding:"required" err:"坐席数量不能为空"`
	RepeatCallCnt    int32   `json:"repeat_call_cnt" binding:"max=5" err:"重播次数最多只能 5 次"`
	PushUserIds      []int64 `json:"push_user_ids" binding:"required" err:"推送设置不能为空"`
}

type UpdateIntentionRequest struct {
	CallInstanceId int64  `json:"call_instance_id" binding:"required" err:"通话记录id不能为空"`
	Intention      string `json:"intention" binding:"required" err:"客户意向不能为空"`
}

type DeleteTaskRequest struct {
	TaskId int64 `json:"task_id" binding:"required" err:"任务 id 不能为空"`
}

type ExecuteTaskRequest struct {
	TaskId  int64 `json:"task_id" `
	Command int32 `json:"command" binding:"oneof=1 2 3" err:"非法的命令"`
}

type ExecuteAllTaskRequest struct {
	Command int32 `json:"command"`
}

type GetOutboundClueDetailRequest struct {
	CallInstanceId int64  `json:"call_instance_id" form:"call_instance_id" binding:"required_without_all=Mobile TaskId" err:"通话记录id不能为空"`
	Mobile         string `json:"mobile" form:"mobile" binding:"required_with=TaskId" err:"手机号参数为空"`
	TaskId         int64  `json:"task_id" form:"task_id" binding:"required_with=Mobile" err:"任务id参数为空"`
	TenantCode     string `json:"tenant_code" form:"tenant_code"`
}

type GetTaskListRequest struct {
	CreateDate string `json:"create_date" form:"create_date"`
	EndDate    string `json:"end_date" form:"end_date"`
	Page       int32  `json:"page" form:"page" binding:"required" err:"需要指定页码"`
	PageSize   int32  `json:"page_size" form:"page_size" binding:"required" err:"需要指定页面大小"`
	TaskName   string `json:"task_name" form:"task_name"`
	TenantCode string `json:"tenant_code" form:"tenant_code"`
}

type GetTaskDetailRequest struct {
	TaskId int64 `json:"task_id" form:"task_id" binding:"required" err:"任务id不能为空"`
}

type GetUnStartCallListRequest struct {
	TaskId   int64 `json:"task_id" form:"task_id" binding:"required" err:"任务id不能为空"`
	Page     int32 `json:"page" form:"page" binding:"required" err:"需要指定页码"`
	PageSize int32 `json:"page_size" form:"page_size" binding:"required" err:"需要指定页面大小"`
}

type GetCrowdByWinbidRequest struct {
	AreaCode              []string `json:"area_code"`
	WinbidKeyword         []string `json:"winbid_keyword"`
	CompanyKeyword        []string `json:"company_keyword"`
	WinbidDateStart       string   `json:"winbid_date_start"`
	WinbidDateEnd         string   `json:"winbid_date_end"`
	EveryCompanyNum       int32    `json:"every_company_num"`
	ContactType           []string `json:"phone_type"`
	LogicType             string   `json:"logic_type"`
	CompanyKeywordExclude []string `json:"company_keyword_exclude"`
	Page                  int32    `json:"page"`
	PageSize              int32    `json:"page_size"`
}

type GetCrowdByDeveloperRequest struct {
	AreaCode              []string `json:"area_code"`
	BidKeyword            []string `json:"bid_keyword"`
	BidKeywordExclude     []string `json:"bid_keyword_exclude"`
	ProjectKeyword        []string `json:"project_keyword"`
	BidDateStart          string   `json:"bid_date_start"`
	BidDateEnd            string   `json:"bid_date_end"`
	LandUsage             []string `json:"land_usage"`
	LandDateStart         string   `json:"land_date_start"`
	LandDateEnd           string   `json:"land_date_end"`
	BuildingType          []string `json:"building_type"`
	BuildingDateStart     string   `json:"building_date_start"`
	BuildingDateEnd       string   `json:"building_date_end"`
	SaleType              []string `json:"sale_type"`
	SaleDateStart         string   `json:"sale_date_start"`
	SaleDateEnd           string   `json:"sale_date_end"`
	EveryCompanyNum       int32    `json:"every_company_num"`
	ContactType           []string `json:"phone_type"`
	IsLandOpen            int32    `json:"is_land_open"`
	IsBuildingOpen        int32    `json:"is_building_open"`
	IsSaleOpen            int32    `json:"is_sale_open"`
	IsBidOpen             int32    `json:"is_bid_open"`
	LogicType             string   `json:"logic_type"`
	LandKeyword           []string `json:"land_keyword"`
	BuildingKeyword       []string `json:"building_keyword"`
	SaleKeyword           []string `json:"sale_keyword"`
	CompanyType           []string `json:"company_type"`
	CompanyKeyword        []string `json:"company_keyword"`
	CompanyKeywordExclude []string `json:"company_keyword_exclude"`
	Page                  int32    `json:"page"`
	PageSize              int32    `json:"page_size"`
}

type CrowdDetailWinbidRequest struct {
	CrowdId  int32 `json:"crowd_id"`
	Page     int32 `json:"page"`
	PageSize int32 `json:"page_size"`
}

type CrowdDetailDeveloperRequest struct {
	CrowdId  int32 `json:"crowd_id"`
	Page     int32 `json:"page"`
	PageSize int32 `json:"page_size"`
}

type GetCrowdByRpaRequest struct {
	ProjectId string `json:"project_id"`
	Page      int32  `json:"page"`
	PageSize  int32  `json:"page_size"`
}

type GetAccountDetailRequest struct {
	Id int64 `json:"id" form:"id"`
}

type ExpenseDetailResponse struct {
	MinutesAmount int64            `json:"minutes_amount"`
	BillingModel  string           `json:"billing_model"`
	SeatsNum      int64            `json:"seats_num"`
	UnitPrice     float32          `json:"unit_price"`
	DetailList    []*ExpenseDetail `json:"detail_list"`
}
type ExpenseDetail struct {
	Date            string  `json:"date"`
	DurationMinutes int64   `json:"duration_minutes"`
	UnitPrice       float32 `json:"unit_price"`
}

type GetAccountDetailResponse struct {
	Id          int64  `json:"id"`
	AccountName string `json:"account_name"`
	CompanyId   int64  `json:"company_id"`
	Status      int32  `json:"status"`
	CreatedOn   string `json:"created_on"`
}

type SaveAccountRequest struct {
	Id          int64  `json:"id"`
	AccountName string `json:"account_name"`
	CompanyId   int64  `json:"company_id"`
}

type SaveAccountResponse struct {
	Id int64 `json:"id"`
}

type AuditOutboundClueRequest struct {
	Id            int64  `json:"id" form:"id" binding:"required" err:"外呼记录id不能为空"`
	TenantCode    string `json:"tenant_code" form:"tenant_code" binding:"required" err:"租户code不能为空"`
	Intention     string `json:"intention" form:"intention" binding:"oneof=A B C D E F" err:"意向参数错误"`
	AuditRemark   string `json:"audit_remark"`
	AuditUserName string `json:"-"`
}
